# -*- coding: utf-8 -*-
# @Time    : 2019/10/3 16:35
# @Author  : LiHaowen
# @Email   : lihaowen2017@163.com
# @File    : asgi.py

"""
ASGI entrypoint. Configures Django and then runs the application
defined in the ASGI_APPLICATION setting.
"""

import os
import sys
import django
from channels.routing import get_default_application
# 查找应用的路径
app_path = os.path.abspath(
    os.path.join(os.path.dirname(os.path.abspath(__file__)), os.pardir)
)
sys.path.append(os.path.join(app_path, "web_ask"))  # ..web_ask/web_ask

os.environ.setdefault("DJANGO_SETTINGS_MODULE", "config.settings.local")
django.setup()
application = get_default_application()
